from selenium.webdriver.common.by import By
from base import Base
class Page(Base):
    def shudian(self):
        ele=(By.XPATH,'(//android.widget.ImageView[@resource-id="com.kongfz.app:id/iv_action_icon"])[1]')
        loc=self.find_ele(ele)
        return loc

    # 点击搜索框
    def kuang(self):
        ele=(By.XPATH,'//android.widget.TextView[@resource-id="com.kongfz.app:id/tv_search"]')
        loc=self.find_ele(ele)
        return loc

        # 输入
    def shuru(self):
        ele = (By.CLASS_NAME, 'android.widget.EditText')
        loc = self.find_ele(ele)
        return loc

        # 按钮
    def anniu(self):
        ele = (By.ID, 'com.kongfz.app:id/rlSearch')
        loc = self.find_ele(ele)
        return loc
    # 图片
    def tupian(self):
        ele=(By.ANDROID_UIAUTOMATOR,'new UiSelector().resourceId("com.kongfz.app:id/ivPic").instance(6)')
        loc = self.find_ele(ele)
        return loc
    # 加入购物车
    def gwc(self):
        ele=(By.ID,'com.kongfz.app:id/tvAddCart1')
        loc = self.find_ele(ele)
        return loc
    def dy(self):
        ele=(By.ID,'com.kongfz.app:id/tvAddCart1')
        loc=self.find_ele(ele)
        return loc

